function ajaxGet(url,cb,data){
    data = data || {};
    let str = "";
    for(let i in data){
        str += `${i}=${data[i]}&`;
    }
    url += `?${str}_yxm_=${Date.now()}`;
    // url += "?"+str+"&"+"_yxm_"+Date.now();
    const xhr = new XMLHttpRequest();
    xhr.open("get",url,true);
    xhr.onreadystatechange = function(){
        if(xhr.readyState === 4 && xhr.status === 200){
            cb(xhr.responseText);
        }
    }
    xhr.send();
}

function ajaxPost(url,cb,data){
    data = data || {};
    let str = "";
    for(let i in data){
        str +=`${i}=${data[i]}&`;    
    }
    const xhr = new XMLHttpRequest();
    xhr.open("post",url,true);
    xhr.onreadystatechange = function(){
        if(xhr.readyState === 4 && xhr.status === 200){
            cb(xhr.responseText);
        }
    }
    xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xhr.send(str.slice(0,str.length-1));
}